import {pget, postJson} from '@/utils/req'
import {modalApi} from '@/utils/modalReq'

// 采购申请分页
export function getTableList(data: any) {
	return pget(
		`${modalApi.personal}/shopec-personal-requisition/requisition/page`,
		data,
	)
}

// 个人信息
export function getUserInfo() {
	return pget(`${modalApi.personal}/personal/center/getUserInfo`)
}

// 审批统计
export function getUserCheckTask() {
	return pget(`${modalApi.personal}/personal/center/getUserCheckTask`)
}

// 分控统计
export function getManagement(data: any) {
	return pget(
		`${modalApi.personal}/personal/center/get/risk/management`,
		data,
	)
}

// 使用指南
export function getUseList(data: any) {
	return pget(`${modalApi.personal}/personal/center/getUseList`, data)
}

// 未读信息
export function getMineMessage(data: any) {
	return pget(`${modalApi.personal}/personal/center/getMineMessage`, data)
}

// 获取附件/图片地址
export function getPublicDownloadUrl(data: any) {
	return postJson(
		`${modalApi.common}/shopec-systembase/baseattachment/getAttachmentFromGiftKeys`,
		data,
	)
}

// 上传附件/图片
export function uploadFromDD(data: any) {
	return postJson(
		`${modalApi.upload}/shopec-systembase/baseattachment/uploadFromDD`,
		data,
	)
}

// 上传保存
export function savePublicDownloadUrl(data: any) {
	return postJson(
		`${modalApi.common}/shopec-systembase/baseattachment/save`,
		data,
	)
}

// 修改文档状态
export function statusModification(data: any) {
	return pget(
		`${modalApi.personal}/base/word/config/update/show/status`,
		data,
	)
}

// 文档详情

export function getModification(data: any) {
	return pget(`${modalApi.personal}/base/word/config/info`, data)
}

// 文档点赞
export function likeModification(data: any) {
	return pget(`${modalApi.personal}/base/word/config/like`, data)
}

// 文档删除
export function removeModification(data: any) {
	return postJson(`${modalApi.personal}/base/word/config/remove`, data)
}

// 获取url
export function getPublicDownloadUrlNew(data: any) {
	return postJson(
		`${modalApi.upload}/shopec-systembase/baseattachment/getPublicDownloadUrl`,
		data,
	)
}
